#include <iostream>
#include <string> 
using namespace std;
int main()
{
 int a=0,b=0;
 string s;
 cin>>s;
 for (char i: s) {
 if (i== ' '){
  a=a+1;
}
 if (i=')'){
  b=b+1;
}
}
 cout<<a<<endl;
 cout<<b;
 return 0;
}
